package com.fesine.produce;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2017/7/28 23:28
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2017/7/28 23:28
 */
public class ProducerThread extends Thread {
    //每次生产商品数量
    private int num;
    //放置的仓库
    private Storage3 storage;

    //创建构造方法，传入storage参数
    public ProducerThread(Storage3 storage,String name) {
        this.storage = storage;
        super.setName(name);
    }


    //生产商品方法，执行storage的生产方法
    public void produce(int num) {
        storage.produce(num);
    }

    @Override
    public void run() {
        produce(num);
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public Storage3 getStorage() {
        return storage;
    }

    public void setStorage(Storage3 storage) {
        this.storage = storage;
    }

}
